﻿using System;
using System.Linq.Expressions;

namespace OS.Infrastructure.Domain
{
    public class SpecificationAdHoc<T> : Specification<T> where T : class
    {
        private readonly Expression<Func<T, bool>> specification;

        public SpecificationAdHoc(Expression<Func<T, bool>> specification)
        {
            this.specification = specification;
        }

        public override Expression<Func<T, bool>> IsSatisfiedBy()
        {
            return specification;
        }
    }
}